#include<bits/stdc++.h>
using namespace std;
const int N=100005;
map<int,int>mp;
int col[N];

int a[N],rd[N],n,cnt=0
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(false);
    cin>>n;

    int len=0;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        mp[a[i]]++;
        if(mp[a[i]]==1)col[++len]=a[i];
    }

    sort(col+1,col+len+1);
    for(int i=1;i<=len;i++){
        a[i]=mp[col[i]];
    }

    for(int i=1;i<=len-1;i++){
        int j=i;
        while(a[i]!=0&&j<=len){
            j=max(j,i);
            while((a[++j]-rd[j])!=0&&j<=len){
                int x=min(a[i],a[j]-rd[j]);
                a[i]=a[i]-x;
                rd[j]+=x;
                cnt=cnt+x;
            }
        }
    }
    cout<<n-cnt;
    return 0;
}
